function createEditorConfig() {
  const componentList = [];
  const componentMap = {};
  const renderRegister = {};
  const previewRegister = {};
  return {
    componentList,
    componentMap,
    renderRegister,
    previewRegister,
    register(component) {
      componentList.push(component);
      componentMap[component.key] = component;
      renderRegister[component.componentName] = component.render;
      previewRegister[component.componentName] = component.preview;
    },
  };
}
const editorConfig = createEditorConfig();

editorConfig.register({
  label: "下拉框",
  componentName: "renderSelect",
  preview: () => import("./render-select.vue"),
  render: () => import("./render-select.vue"),
  key: "select",
});
editorConfig.register({
  label: "按钮",
  componentName: "renderButton",
  preview: () => import("./render-button.vue"),
  render: () => import("./render-button.vue"),
  key: "button",
});
editorConfig.register({
  label: "输入框",
  componentName: "renderInput",
  preview: () => import("./render-input.vue"),
  render: () => import("./render-input.vue"),
  key: "input",
});
export default editorConfig;
